<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>题目列表</title>
	<script src='/static/js/jquery-1.12.1.min.js'></script>
	<script src='/static/js/kindeditor/kindeditor-all-min.js'></script>
</head>
<body>

		标题:<input type="text" id="t1"  />
		
		<br /><br />
		<input id="myb" type="button" value="查找" onclick="sub()" />

		<table id='tb'>
			<thead>
			<th><td>职位标题</td></th>
		</thead>
		<tbody>


		</tbody>

		</table>


    <script>


		function sub(){

			
			if($("#t1").val()==''){
				alert('标题不能为空')
				return false;
			}

var aj1 = $.ajax({
    type: "GET",
    url:"/find",
        async:true,
        dataType:'json',
        data:{'word':$("#t1").val()},
		beforeSend: function(){
     // Handle the beforeSend event
	 $('#myb').attr("disabled",true);
    },
    complete: function(){
     // Handle the complete event
	 $('#myb').attr("disabled",false);
    },
    success: function(msg){

		var mylist = msg.result;

		$("#tb tbody").html("");
		for(var i=0;i<mylist.length;i++){

					$("#tb tbody").append("<tr><td>"+mylist[i]['title']+"</td></tr>");
		
		}



    },error: function(xhr){
        alert("请求出错(接口宕机)");  
}
});

}
    
    
    </script>



    
</body>
</html>